package net.melon.logger.inst.struts2;

import java.util.Iterator;

import javax.inject.Inject;

import net.esj.basic.view.BaseAction;
import net.melon.logger.manage.LoggerManage;

public class TailerAction extends BaseAction {

	private String file;
	
	private LoggerManage loggerManage;
	
	public void start(){
		loggerManage.startTail(file);
	}

	public void stop(){
		loggerManage.stopTail();
	}
	
	public void tail(){
		Iterator<String> itl = loggerManage.tail();
		writeJson(itl);
	}
	
	public String getFile() {
		return file;
	}

	public void setFile(String file) {
		this.file = file;
	}

	@Inject
	public void setLoggerManage(LoggerManage loggerManage) {
		this.loggerManage = loggerManage;
	}
	
}
